#include "setfriendnickname.h"
#include "ui_setfriendnickname.h"

setFriendNickname::setFriendNickname(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::setFriendNickname)
{
    ui->setupUi(this);
}

setFriendNickname::setFriendNickname(QString name, QString ID, QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::setFriendNickname)
{
    ui->setupUi(this);
    UIDesign::setButtonUI(ui->submit);
    UIDesign::setLineEditUI(ui->Nickname);
    UIDesign::setTransparent(ui->label);
    UIDesign::setWindowUI(ui->centralwidget);
    setWindowFlags(Qt::FramelessWindowHint);
    setFixedSize(this->width(), this->height());
    this->setAttribute(Qt::WA_TranslucentBackground);

    uName = name;
    unId = ID;
}


setFriendNickname::~setFriendNickname()
{
    delete ui;
}

void setFriendNickname::on_submit_clicked()
{
    QString nickname = ui->Nickname->text();
    emit(signalSetFriendNickname(uName, unId, nickname));
    this->close();
}
